/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

/**
 * <p>Project: jse2303 - Ex
 * <p>Powered by webrx On 2023-07-12 09:16:26
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex {
    public static void main(String[] args) {
        long t = 1689124601280L - (1000 * 60 * 60 * 24 * 6);
        String msg = "你好";
        //System.out.printf("%tF %<tT : %s%n", t, msg);
        long n = System.currentTimeMillis();
        long ss = (n - t) / 1000;
        long mm = ss / 60;
        long hh = mm / 60;
        long dd = hh / 24;
        if (mm < 1) {
            System.out.printf("刚刚 : %s%n", msg);
        } else if (hh < 1) {
            System.out.printf("%d分钟前 : %s%n", mm, msg);
        } else if (dd < 1) {
            System.out.printf("%d小时前 : %s%n", hh, msg);
        } else if (dd < 6) {
            System.out.printf("%d天前 : %s%n", dd, msg);
        } else {
            System.out.printf("%tF %<tT : %s%n", t, msg);
        }
    }
}
